package com.study.observer.gper;

import java.util.Observable;

public class GPer extends Observable {
    private String name = "GPer生态圈";
    private static final GPer gPer= new GPer();

    private GPer() {
    }

    public static GPer instance(){
        return gPer;
    }

    public String getName() {
        return name;
    }

    public void publishQuestion(Question question){
        System.out.println(question.getUserName() + "在" + this.name + "上发布了一个问题：" + question.getContent());
        setChanged();
        notifyObservers(question);
    }
}
